FNuller< T > Struct Template Reference

Template definition for classes that help resetting an object's value. More...

#include <fcleanup.h>

Public Member Functions

 FNuller (T &_toNull)
 Constructor. _toNull is a reference to the object that is to be assigned 0 when this FNuller object's destructor is executed.
 ~FNuller ()
 Destructor. Assigns 0 to the at construction time passed object reference.

Data Fields

T & toNull
 Remembers the object that is to be assigned 0 during destruction.

Detailed Description

template<class T>
struct Steinberg::FNuller< T >

Template definition for classes that help resetting an object's value.

A stack allocated object of this type autonomically resets the value of an at construction time passed object to null when it reaches the end of its scope.

Intended usage:

   int theObject = 0;
   {
      Steinberg::FNuller<int> theNuller (theObject);

      theObject = 1;

   } // Here the destructor of theNuller resets the value of theObject to 0.

Constructor & Destructor Documentation

FNuller ( T &  _toNull  )  [inline]

Constructor. _toNull is a reference to the object that is to be assigned 0 when this FNuller object's destructor is executed.

~FNuller (  )  [inline]

Destructor. Assigns 0 to the at construction time passed object reference.


Field Documentation

T& toNull

Remembers the object that is to be assigned 0 during destruction.

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
Empty

Copyright ©2013 Steinberg Media Technologies GmbH. All Rights Reserved.